﻿namespace EFS.RC.CC.Applications.EndPoints
{
	/// <summary>
	/// Application end point
	/// </summary>
	internal abstract class Presence<EndPointDeployment, EndPointPresenceDeployment> : EFS.RC.CC.Applications.EndPoints.EndPoint<EndPointDeployment>
		where EndPointDeployment : EFS.RC.CC.Deployment.Entities.EndPoint
		where EndPointPresenceDeployment : EFS.RC.CC.Presences.Deployment<EndPointDeployment>
	{
		#region Components

		// Presence
		private EndPointPresenceDeployment endPointApplicationPresence = null;

		#endregion

		#region Constructor

		/// <summary>
		/// Constuctor
		/// </summary>
		/// <param name="endPointApplicationPresence"></param>
		public Presence(Microsoft.Rtc.Collaboration.ApplicationEndpointSettings applicationEndpointSettings, EndPointPresenceDeployment endPointApplicationPresence)
			:base(applicationEndpointSettings)
		{
			// check
			EFS.Common.Verify.Reference(endPointApplicationPresence, "endPointApplicationPresence");

			// set
			this.endPointApplicationPresence = endPointApplicationPresence;

			// log
			EFS.EventLog.Log.LogInfo("EndPoint", this);
		}

		#endregion

		#region Usage

		/// <summary>
		/// Describe this object
		/// </summary>
		/// <returns></returns>
		public override System.String Describe()
		{
			return System.String.Format("EFS.RC.CC.Applications.EndPoints.Presence [{0}] [{0}]", base.Describe(), endPointApplicationPresence.Describe());
		}

		/// <summary>
		/// End point presence
		/// </summary>
		public EndPointPresenceDeployment ApplicationPresence
		{
			get { return endPointApplicationPresence; }
		}

		#endregion
	}
}
